package com.fly.r2dbc.basics.service;

import org.springframework.data.domain.Pageable;

import com.fly.r2dbc.basics.entity.Customer;

import reactor.core.publisher.Flux;

/**
 * 
 * CustomerService 接口
 * 
 * @author 00fly
 * @version [版本号, 2023-05-18]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public interface CustomerService
{
    /**
     * 新增
     * 
     * @param customer
     * @see [类、类#方法、类#成员]
     */
    void insert(Customer customer);
    
    /**
     * 根据id删除
     * 
     * @param id
     * @see [类、类#方法、类#成员]
     */
    void deleteById(Long id);
    
    /**
     * 根据id更新
     * 
     * @param customer
     * @see [类、类#方法、类#成员]
     */
    void update(Customer customer);
    
    /**
     * 新增/根据id更新
     * 
     * @param customer
     * @see [类、类#方法、类#成员]
     */
    void saveOrUpdate(Customer customer);
    
    /**
     * 根据id查询
     * 
     * @param id
     * @return
     * @see [类、类#方法、类#成员]
     */
    Customer queryById(Long id);
    
    /**
     * findAll
     * 
     * @return
     * @see [类、类#方法、类#成员]
     */
    Flux<Customer> findAll();
    
    /**
     * 
     * @param pageable
     * @return
     */
    Flux<Customer> findBy(Pageable pageable);
    
    long count();
}
